//1281. 整数的各位积和之差


class Solution {
public:
    int subtractProductAndSum(int n) {
        int pro = 1, sum = 0;
        while(n)
        {
            int tmp = n % 10;
            pro *= tmp;
            sum += tmp;

            n /= 10;
        }
        return pro-sum;
    }
};